package com.omar.labs.tamtamy.JSON;

import java.util.ArrayList;

import com.omar.labs.tamtamy.ContentLink;
import com.omar.labs.tamtamy.TagList;
import com.omar.labs.tamtamy.UserDetail;

public class JSONUserDetail extends UserDetail {

	public JSONUserDetail(String json) {		
		this.userID = JSONUtility.getNodeValue(json, "\"userID\"");
		this.nickname = JSONUtility.getNodeValue(json, "\"nickname\"");
		this.firstName = JSONUtility.getNodeValue(json, "\"firstName\"");
		this.lastName = JSONUtility.getNodeValue(json, "\"lastName\"");
		//this.birthday = JSONUtility.getNodeValueWithAttribute(json, "\"birthday", "class=\"sql-timestamp\"\"");
		this.gender = JSONUtility.getNodeValue(json, "\"gender\"");
		this.diskQuotaLimit = JSONUtility.getNodeValue(json, "\"diskQuotaLimit\"");
		this.company = JSONUtility.getNodeValue(json, "\"company\"");
		this.mail = JSONUtility.getNodeValue(json, "\"mail\"");
		this.jabberMessenger = JSONUtility.getNodeValue(json, "\"jabberMessenger\"");
		this.msnMessenger = JSONUtility.getNodeValue(json, "\"msnMessenger\"");
		this.instantMessenger = JSONUtility.getNodeValue(json, "\"instantMessenger\"");
		this.blog = JSONUtility.getNodeValue(json, "\"blog\"");
		this.interest = JSONUtility.getNodeValue(json, "\"interest\"");
		this.avatarFileName = JSONUtility.getNodeValue(json, "\"avatarFilename\"");
		this.online = Boolean.parseBoolean(JSONUtility.getNodeValue(json, "\"onLine"));
		this.department = JSONUtility.getNodeValue(json, "\"department\"");
		this.contentList = new JSONContentList(JSONUtility.getNodeValueWithList(json, "\"contentList\""));
		this.tagList = new JSONTagList(JSONUtility.getNodeValueWithList(json, "\"tagList\""));
	}

}
